package com.zyx.tr1;

public class Thread01 extends Thread{
    private Thread02 thrad02;

    @Override
    public void run() {
        for(int i=0;i<10;i++) {
            try {
                Thread.sleep(300);
                System.out.println("黑龙:" + i);
                if (i == 5) {
                    thrad02.join();
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public Thread02 getTh2() {
        return thrad02;
    }

    public void setTh2(Thread02 th2) {
        this.thrad02 = th2;
    }

}
